#include<cstdio>
#include<algorithm>

using namespace std;
const int maxn=1e5+10;
int a[maxn],b[maxn];
int n,m;


int main()
{
	fill(a,a+maxn,0);
	fill(b,b+maxn,0);
	scanf("%d%d",&n,&m); 
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		b[i]=a[i]-a[i-1];
	}
	
	while(m--){
		int l,r,c;
		scanf("%d%d%d",&l,&r,&c);
		b[l]+=c;
		b[r+1]-=c;
	}
	
	for(int i=1;i<=n;i++){
		a[i]=a[i-1]+b[i];
		printf("%d",a[i]);
	}
	return 0;
}
